home *** CD-ROM | disk | FTP | other *** search
/ SuperView Productivity Suite 2 / SuperView Productivity Suite 2.iso / BONUS / Support / SVII-ProcessPics / SV-SlideShow.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1998-10-12  |  10.9 KB  |  295 lines

  1. /*******************************************************************************************************************************/
  2. in_txt1 = "SV-Slideshow.rexx V 1.06 04.10.98 © by Ulrich Falke"
  3. in_txt2 = "==================================================="                                                                /*
  4.  
  5. Script that shows given files of a directory,
  6. using SViewII (registered) © by Andreas Ralph Kleinert,
  7. RexxReqTools.library © by Rafael D'Halleweyn and of course
  8. ReqTools.library © by Nico François and Magnus Holmgren.
  9.  
  10. With this script I test my ARexx-skills, it's long time ago that I write ARexx-scripts.
  11. It's easyer to find errors here, than in the bigger SV-ProcessPics-script.
  12. From here I take working parts to the bigger SV-ProcessPics-script, so the history's may not
  13. have big differences.
  14.  
  15. Attention: If the SV-WindowDriver shows a pic that is bigger
  16.            than the display, you can scroll with the cursor-keys.
  17.            The script waits for a keyboard or mouse-button press.
  18.  
  19. History:   V 1.00 Initial release.
  20.                   With SVII-ProcessPics V 2.11 05.09.98 UpLoad to Aminet.
  21.  
  22.            V 1.01 add: Take requesters ect. from SVII-ProcessPics to make
  23.                        things easyer to test.
  24.                   add: Now it's possible to choose the SV-screendriver
  25.                        and the screenmode.
  26.                   add: Chancel-requester.
  27.                   add: Text-output to CON:
  28.  
  29.            V 1.02 add: Now it's possible to choose the SV-screendriver, that you set with SV-Prefs.
  30.  
  31.            V 1.03 add: Save prefs to 'ENVARC:SV-Slideshow.prefs'
  32.                        (last used pic-path, screenmode and SV-Driver).
  33.                   changed: Now you get always the last used pic-path in the file-requester,
  34.                            if you choose in the SV-ScreenDriver-request 'Last used', the last
  35.                            used screenmode and SV-Driver will be used again.
  36.                   add: Improved text-output to CON: (pic-path+name, pic-size).
  37.  
  38.            V 1.04 add: Default-settings if no prefsfile ( path = SYS: , SV-Driver = AGA/RTG WindowDriver )
  39.  
  40.            V 1.05 Correct problems with spaces in device- or pathname (problem with ReqTools-fr).
  41.                   add: If the last used pic-path did'nt exists anymore (like changed CD-ROM), the default-path
  42.                        will be used.
  43.                   With SVII-ProcessPics V 2.20 03.10.98 UpLoad to Aminet.
  44.  
  45.            V 1.06 changed: Take changes, that I have made and testet in SVII-ProcessPics.rexx V 2.20.
  46.                            Better ERROR handling.
  47.                            All requesters have now keyboard-shortcuts.
  48.                            Shorten the interpretation of the LIBRARY.controlpad.
  49.  
  50. ===============================================================================================================================*/
  51.  
  52. OPTIONS RESULTS
  53. OPTIONS FAILAT 21
  54. SIGNAL ON ERROR
  55. SIGNAL ON break_c
  56. SIGNAL ON break_d
  57. SIGNAL ON failure
  58. SIGNAL ON halt
  59. SIGNAL ON ioerr
  60. SIGNAL ON syntax
  61.  
  62. SV = 'SYS:SViewII/SViewII'                            /* the path to SViewII, change it to your needs! */
  63.  
  64. SVIIPORT = 'SViewII.rx'                               /* default ARexx-Port of SViewII */
  65.  
  66. showtime = 5                                          /* how long should every pic shown ? */
  67.  
  68. txt_svdr0 = '_Window'                                 /* works on AGA- and RTG-Screens */
  69. txt_svdr1 = '_CGX|'                                   /* I think most people use CGX */
  70. txt_svdr2 = 'use SV-_Prefs|'                          /* Screendriver that you set in SV-Prefs */
  71. txt_svdr3 = '_Last used|'                             /* Last used Screendriver saved in ENVARC:SV-Slideshow.prefs */
  72.  
  73. /*============================================ please don't change anything below this line ===================================*/
  74.  
  75. SVII = 'Run >NIL: 'SV' -INSTALL_APPMENU=FALSE -INSTALL_APPICON=FALSE'
  76.  
  77. NL = '0a'x
  78. BL = ''
  79. NR = ''
  80. WS = ''
  81. HG3 = ''
  82. win = 0
  83.  
  84. say BL||in_txt1||NL||in_txt2||NR
  85.  
  86. IF ~SHOW('L',"rexxreqtools.library") THEN CALL ADDLIB("rexxreqtools.library",0,-30)
  87. IF ~SHOW('L',"rexxreqtools.library") THEN DO
  88.     SAY "Could not open the RexxReqTools.library !"
  89.     Call Error
  90. END
  91.  
  92. IF ~SHOW('P',SVIIPORT) THEN DO
  93.    address command
  94.    SVII
  95.    'WaitForPort' SVIIPORT
  96. END
  97.  
  98. ADDRESS VALUE SVIIPORT
  99.  
  100. call text
  101.  
  102. IF OPEN('Prefs','ENV:SV-Slideshow.prefs','r') THEN DO    /* read Prefsfile */
  103.     Dir = READLN('Prefs')
  104.     SVDR = READLN('Prefs')
  105.     ScreenMode1 = READLN('Prefs')
  106.     CLOSE('Prefs')
  107. END
  108. ELSE do                                                  /* no Prefsfile */
  109.     Dir = 'SYS:'
  110.     SVDR = 'AGA/RTG WindowDriver'
  111.     win = 1
  112. END
  113.  
  114. IF EXISTS(Dir) = 0 THEN DO
  115.     call rtfreefilebuffer()
  116.     Dir = 'SYS:'
  117. END
  118.  
  119. call rtfilerequest(Dir,,'Pick files to show',,,          /* ReqTools-Filerequester - get a list of all files to show */
  120.                      'rtfi_flags=freqf_multiselect',
  121.                      'rtfi_buffer=true',
  122.                      'rt_reqpos=reqpos_centerscr',files)
  123.  
  124. if files == 0 then do                                    /* you chancel */
  125.         call rtezrequest('You did not select'||NL||,
  126.                          'a picture to show.'||NL||,
  127.                          'I stop working !',,
  128.                          '_OK',,
  129.                          'Chancel-Requester',,
  130.                          'rtez_flags = ezreqf_centertext',
  131.                          'rt_reqpos=reqpos_centerscr')
  132.         call Ausgang
  133. END
  134.  
  135. if files == 1 then DO
  136.  
  137.     parse var files.1 LW ':' DN
  138.     Pfad = ''
  139.     do forever
  140.        parse var DN Pfad1 '/' DN
  141.        if DN = ''
  142.           then break
  143.           Pfad = Pfad||Pfad1'/'
  144.     end
  145.     Dir = LW||':'||Pfad
  146.  
  147.     SD = rtezrequest('Which SV-ScreenDriver do you like to use ?',,   /* witch SVDriver */
  148.                      txt_svdr1||txt_svdr2||txt_svdr3||txt_svdr0,,
  149.                      in_txt1,,
  150.                      'rtez_flags = ezreqf_centertext',
  151.                      'rtez_defaultresponse = 0',
  152.                      'rt_reqpos=reqpos_centerscr')
  153.  
  154.     if SD = 0 then do
  155.         'SVDRIVER=AGA/RTG WindowDriver'
  156.         win = 1
  157.         SVDR = 'AGA/RTG WindowDriver'
  158.         ScreenMode = ScreenMode1
  159.     END
  160.  
  161.     if SD > 0 then win = 0
  162.  
  163.     if SD = 1 then do
  164.         'SVDRIVER=CyberGraphX ScreenDriver'
  165.         SVDR = 'CyberGraphX ScreenDriver'
  166.     END
  167.  
  168.     if SD = 2 then do
  169.         IF OPEN('PrefsDriver','env:superview-library/LIBRARY.controlpad','R') THEN DO
  170.             PrefsDriver_txt = READLN('PrefsDriver')
  171.             CLOSE('PrefsDriver')
  172.             parse var PrefsDriver_txt def '=' SVPD
  173.             if SVPD = 'AGA.svdriver' then SVDR = 'AGA ScreenDriver'
  174.             if SVPD = 'CyberGraphics.svdriver' then SVDR = 'CyberGraphX ScreenDriver'
  175.             if SVPD = 'ECS.svdriver' then SVDR = 'ECS ScreenDriver'
  176.             if SVPD = 'EGS7.svdriver' then SVDR = 'EGS7 ScreenDriver'
  177.             if SVPD = 'MERLIN.svdriver' then SVDR = 'MERLIN ScreenDriver'
  178.             if SVPD = 'OPAL.svdriver' then SVDR = 'OPAL ScreenDriver'
  179.             if SVPD = 'Picasso96.svdriver' then SVDR = 'Picasso96 ScreenDriver'
  180.             if SVPD = 'PicassoII.svdriver' then SVDR = 'PicassoII ScreenDriver'
  181.             if SVPD = 'Retina.svdriver' then SVDR = 'Retina Driver'
  182.             if SVPD = 'Window.svdriver' then do
  183.                 SVDR = 'AGA/RTG WindowDriver'
  184.                 win = 1
  185.             END
  186.             'SVDRIVER='||SVDR
  187.         END
  188.     END
  189.  
  190.     if SD = 3 then do
  191.         'SVDRIVER='||SVDR
  192.         'VIEWMODE='ScreenMode1
  193.         ScreenMode = ScreenMode1
  194.         win = 1
  195.     END
  196.  
  197.     IF win = 0 THEN DO                                   /* select screenmode if'nt window-driver or last used */
  198.         call rtscreenmoderequest('Please select the ScreenMode for your SV-ScreenDriver',,,
  199.                                  'rtsc_flags = screqf_sizegads|screqf_depthgad',
  200.                                  'rt_reqpos=reqpos_centerscr',screen)
  201.         ScreenMode = screen.name
  202.         'VIEWMODE='ScreenMode
  203.  
  204.         if screen = '0' then do                          /* you chancel screenmode requester */
  205.             call rtezrequest('You did not select a ScreenMode'||NL||,
  206.                              'I try the last used ScreenMode !',,
  207.                              '_OK',,
  208.                              'No ScreenMode',,
  209.                              'rtez_flags = ezreqf_centertext',
  210.                              'rt_reqpos=reqpos_centerscr')
  211.             'VIEWMODE='ScreenMode1
  212.             ScreenMode = ScreenMode1
  213.         END
  214.     END
  215.  
  216.     IF OPEN('Prefs','ENVARC:SV-Slideshow.prefs','w') THEN DO
  217.         WRITELN('Prefs',Dir)
  218.         WRITELN('Prefs',SVDR)
  219.         WRITELN('Prefs',ScreenMode)
  220.         CLOSE('Prefs')
  221.         address command copy 'ENVARC:SV-Slideshow.prefs TO ENV:'
  222.     END
  223. END
  224.  
  225. if files == 1 then
  226.                                                          
  227.                  do i=1 to files.count                   /* repeat loop until all files have been shown */
  228.                                                          
  229.                  'SHOW='||files.i                        /* load the picture */
  230.  
  231.                  'STATUS=T:SVStatus'
  232.                  IF OPEN('Stat','T:SVStatus','R') THEN DO
  233.                     Stat_txt = READLN('Stat')
  234.                     CLOSE('Stat')
  235.                     say i||". "||files.i||" "||Stat_txt
  236.                  END
  237.                                         
  238.                  address command Wait showtime           /* how long show each picture */
  239. END
  240.  
  241. 'UNSHOW'
  242.                                                          
  243. say (i-1)' pictures were shown successfully.'            /* tell the user it's done o.k. */
  244. say BL||WS||HG3||tx||NR
  245. address command Wait showtime
  246.  
  247. call Ausgang
  248.  
  249. ERROR:                                                   /* ERROR Procedure */
  250. failure:
  251. ioerr:
  252. syntax:
  253.  
  254. call rtezrequest('+++ ERROR +++'||NL||,
  255.                  'No.: '||RC||' '||ErrorText(RC)||NL||,
  256.                  'in Line' sigl '--> 'SOURCELINE(sigl)' <--',,
  257.                  'Please send an e-mail to : _UFalke@t-online.de',,
  258.                  'ERROR-Requester',,
  259.                  'rtez_flags = ezreqf_centertext',
  260.                  'rt_reqpos = reqpos_centerscr')
  261. call Ausgang
  262.  
  263. break_c:
  264. break_d:
  265. halt:
  266.  
  267. call rtezrequest('You type CTRL-c !'||NL||,
  268.                  'I''m stop working !',,
  269.                  '_OK',,
  270.                  'Chancel-Requester',,
  271.                  'rtez_flags = ezreqf_centertext',
  272.                  'rt_reqpos = reqpos_centerscr')
  273. call Ausgang
  274.  
  275. Ausgang:
  276.  
  277. 'UNSHOW'
  278. IF EXISTS('t:SVStatus') THEN address command 'c:delete t:SVStatus QUIET'
  279. EXIT
  280.  
  281. END
  282. text:
  283. /*
  284.  
  285.                            /\                 Ulrich Falke
  286.                   __       \/ _               Jakobistr. 2
  287.                __/// /||\/||¯/_ /|            D-59494 Soest
  288.                \XX/ /¯||  || \//¯|                                                                                             */
  289.  
  290. tx='AMIGA definately BACK FOR THE FUTURE ---  UFalke@t-online.de'                                                              /*
  291.  
  292. A3000/060-50MHz+PPC403e-200MHz/70MB RAM/~7GB HD's/Toshiba XM3701S/CVisionPPC-CGX V3/Mitsubishi 16Zoll Monitor
  293. */
  294.  
  295.